<template>
	<view>
		<hx-navbar ref="hxnb" :config="config">
			<block slot="max">
				<view class="nav_wrap flex">
					<view class="back_wrap flex" @click="back">
						<u-icon name="arrow-left" color="#fff" size="36"></u-icon>
					</view>
					
				</view>
			</block>
		</hx-navbar>
		<view class="main-div">
			<image class="main-bg" src="../../../static/img/lawyerVersion/xibao-bg.png" mode=""></image>
			<view class="zhanwei" :style="{'height':statusBarHeight+'rpx'}"></view>
			<view class="m-d">
				<view class="m-d-t">
					成单喜报
				</view>
				<view class="m-d-j">
					快去寻找你的案源吧！
				</view>

			</view>
		</view>
		<view class="xb-div">
			<view class="flex xb-item" v-for="(item,index) in list" :key="index" @click="todetail(item)">
				<view class="headimg">
					<image class="headimg" :src="item.l_user.avatar" mode=""></image>
				</view>
				<view class="u-m-l-20">
					<view class="">
						恭喜{{item.l_user.name}}{{item.l_user.type==1?'律师':'法学生'}}在北京成案{{item.price}}元
					</view>
					<view class="font_12_999 u-m-t-16">
						{{item.created_at}}
					</view>
				</view>
			</view>
		</view>
		<image @click="toadd" class="xibao-add" src="../../../static/img/lawyerVersion/xibao-add.png" mode=""></image>
	</view>
</template>

<script>
	var statusBarHeight = (uni.getSystemInfoSync().statusBarHeight * 2);
	export default {
		data() {
			return {
				statusBarHeight: statusBarHeight,
				config: {
					maxSlot: true,
					back: false,
					barPlaceholder: false,
					backgroundColor: [0, '#fff'],
					slideBackgroundColor: [1, '#E39019']
				},
				list:[]
			}
		},
		onPageScroll(e) {
			// 重点，用到滑动切换必须加上
			this.$refs.hxnb.pageScroll(e);
		},
		onShow() {
			this.gelist()
		},
		methods: {
			gelist(){
				this.$api({
					url: '/lawyer/success_order',
					method: 'get',
					data: {
						token:uni.getStorageSync("token"),
						limit:100 
					},
				}).then(res => {
					if (res.code == 1) {
						this.list = res.data.data
					} 
				})
			},
			
			back() {
				uni.navigateBack()
			},
			todetail(e){
				uni.navigateTo({
					url: "/subPackageA/pages/lawyerVersion/index/goodNewsDetail?id="+e.id
				})
			},
			toadd(){
				uni.navigateTo({
					url: "/subPackageA/pages/lawyerVersion/index/goodNewsAdd"
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.xibao-add{
		position: fixed;
		right: 20rpx;
		bottom: 200rpx;
		z-index: 15;
		width: 120rpx;
		height: 120rpx;
	}
	.nav_wrap {
		width: 100vw;
		position: relative;
		height: 88rpx;
	
		.back_wrap {
			position: absolute;
			left: 24rpx;
	
			.diqu {
				font-weight: 600;
				font-size: 32rpx;
				color: #FFFFFF;
				margin: 0 12rpx;
			}
	
			.dq-icon {
				width: 28rpx;
				height: 34rpx;
			}
		}
	
		.page_title {
			width: 100vw;
			text-align: center;
			font-weight: bold;
		}
	}
	.main-div {
		position: relative;
		width: 100%;
		background-color: #FFE7AF;
		height: 400rpx;
		display: flex;
		flex-direction: column;

		.main-bg {
			width: 100%;
			height: 400rpx;
			position: absolute;
			top: 0;
			z-index: 0;
		}

		.m-d {
			position: relative;
			padding-top: 88rpx;
			z-index: 2;
			// height: 100%;
			text-align: center;
			width: 100%;
			flex: 1;
		}
	}

	.m-d-t {
		position: absolute;
		bottom: 164rpx;
		left: 288rpx;
		font-weight: 600;
		font-size: 44rpx;
		color: #FFFBE8;
	}

	.m-d-j {
		position: absolute;
		bottom: 84rpx;
		left: 256rpx;
		font-size: 24rpx;
		color: #B45900;

	}

	.headimg {
		width: 72rpx;
		height: 90rpx;
		background-color: #eee;
	}

	.xb-div {
		margin-top: -60rpx;
		position: relative;
		z-index: 2;

		.xb-item {
			width: 686rpx;
			// height: 138rpx;
			background: #FFFFFF;
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			padding: 24rpx;
			margin: 16rpx auto;
		}
	}
</style>